package com.eco.mam.work.request.resource;

import java.util.Properties;

import org.apache.log4j.Logger;

import com.eco.mam.work.ConfigParameters;
import com.eco.mam.work.DataException;

/*This class is responsible for providing  key values from a property file.All input,output 
 *  file/directory and database information  are mapped in properties file.*/
public class WorkRequestConfig {

static final Logger logger = Logger.getLogger(WorkRequestConfig.class);
	private   static Properties resource = null;

	/*
	 * public WorkRequestConfig() { resource = Resources.load("config"); }
	 * public WorkRequestConfig(String strFileName) { resource =
	 * Resources.load(strFileName); }
	 */

	static {
		try {
			resource = new Resources().load(ConfigParameters.CONFIG_FILE );
		} catch (DataException e) {
			if (logger.isDebugEnabled()) {
				{
					logger.debug(e);
				}

			}
		}
	}

	/*
	 * Responsible to provide the the file name from a property file.All the input and output files
	 * (csv-to get the csv data,xml file-to write the transformed xml)
	 */
	public static String getFileName(String fileName) {

		return resource.getProperty(fileName);
	}
}
